package cn.jimmie.learn.sdk.ui;

import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.widget.Toast;

import cn.jimmie.learn.pbc.base.BaseActivity;
import cn.jimmie.learn.pbc.base.BaseFragment;
import cn.jimmie.learn.sdk.R;


/**
 * function :
 *
 * <p> Create Time:  2019年02月12日 18:07 </p>
 * <p> @author Jimmie.Qian  </p>
 */
public class PluginHostActivity extends BaseActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sdk_fragment_activity);

        usePluginResource(false);
        startLoadingFragment();
    }

    private void startLoadingFragment() {
        Toast.makeText(this, "插件加载...", Toast.LENGTH_SHORT).show();
        BaseFragment fragment = new LoadingFragment();
        fragment.setContainerId(R.id.sdk_fragment_container);
        FragmentManager fm = this.getSupportFragmentManager();
        FragmentTransaction ft = fm.beginTransaction();
        ft.replace(R.id.sdk_fragment_container, fragment);
        ft.commitAllowingStateLoss();
    }
}
